<% if flash[:message] %>
<div class="message"><%= flash[:message] %></div>
<% end %>
<% if flash[:warning] %>
<div class="warning"><%= flash[:warning] %></div>
<% end %>

<h2>Welcome <%= "#{@user.name}(#{@user.ident})" %>
<%= link_to "Edit Password", :action => 'edit' %>
<%= link_to "Log Out" , :action => 'logout' %>
</h2>

<h3><div id="msg" class="message"></div></h3>

<table border=1>
<tr>
<th width="10px"> No. </th>
<th width="80px"> Lab </th> <th width="350px"> Online judge </th> <th width="300px">Last Submission</th>
<th width="120px"> Score(Max 5) </th>
</tr>
<% @list.each do |l| %>
<% lid="Lab#{l[0].id}" %>
<tr>
  <td valign="left"><%= l[0].id %></td>
  <td valign="left"><%= l[0].name %></td>
  <% form_tag({:controller => 'upload',:action => 'uploadFile',:lab_id => l[0].id }, :multipart => true) do %>
  <td valign="left">
    
   Select File:<%= file_field 'upload', 'datafile', :size => 10 %>
   <input name="submit" type="submit" value="Submit"  />
  </td>
  <% end %>
  <td valign="middle"><%= if l[1].nil? then 
			  "Not Sumbitted Yet" 
			  else 
			  link_to l[1].updated_at.to_s,l[1].store 
			  end %></td>
  <td valign="middle" id="<%=lid%>"><%= if l[1].nil? then 0 else l[1].res end %></td>
</tr>
<% end %>
</table>

